<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<?php
echo "<h1>修改界面</h1>";
if(!isset($_GET['id'])){
    echo "没有参数ID";
}
$id = $_GET["id"];
$name = $_GET["name"];
$pass = $_GET["pass"];
//echo $id,$name,$pass;

try{
    $pdo = new PDO("mysql:dbname=liu;host=127.0.0.1","root","");
    $pdo->exec("SET NAMES 'utf8'");

}catch (PDOException $e){
    echo "错误信息：".$e->getMessage();
}

$sql = "UPDATE log_user SET `log_name`= '$name',`log_pass` = '$pass' WHERE `log_id` = $id;";
$res = $pdo->exec($sql);

if($res > 0){
    echo "修改成功<br>3秒后会跳转回去";
    echo '<meta http-equiv="refresh" content="3;url=tb_print.php">';
}